home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gekkan Dennou Club 145
/
Gekkan Dennou Club - 2000.6 Vol. 145 (Japan).7z
/
Gekkan Dennou Club - 2000.6 Vol. 145 (Japan) (Track 1).bin
/
games
/
spassion
/
source.lzh
/
SOURCE
/
FuncEnemy
/
BOSS01.C
< prev
next >
Wrap
Text File
|
2000-03-27
|
19KB
|
557 lines
/*
#include <stdio.h>
#include <iocslib.h>
*/
/* 腕を広げてレーザーとか */
#include <xsp2lib.h>
#include "../SPASSION.H"
#include "../player.h"
#include "../enemy.h"
#include "../eshot.h"
#include "../effect.h"
#include "../priority.h"
#include "../sound.h"
#include "../entry.h"
#include "../SUB.H"
#ifndef NULL
#define NULL ((void *) 0)
#endif
#define PALET_MAIN 0x0700
#define P_X (*((short *) (&player[0].lx))) /*lxの上位ワード*/
#define P_Y (*((short *) (&player[0].ly))) /*lyの上位ワード*/
static short MoveEnemyBoss01(ENEMY *);
/*static void TiniEnemyBoss01(ENEMY *);*/
static short MoveEnemyCore1( ENEMY *ene );
static short MoveEnemyCore2( ENEMY *ene );
static short MoveEnemyCore4( ENEMY *ene );
static short MoveEnemyShield( ENEMY *ene );
/* 中心の細い棒のところ*/
static HIT_XY4 hit0_0_p={ -40-PLAYER_HIT_X, - 1-PLAYER_HIT_Y, 0+PLAYER_HIT_X, 1+PLAYER_HIT_Y};
/* 中心部分の芯のところ*/
static HIT_XY4 hit0_1_p={ -16-PLAYER_HIT_X, -16-PLAYER_HIT_Y, 32+PLAYER_HIT_X, 16+PLAYER_HIT_Y};
/* 中心部分の後ろ */
static HIT_XY4 hit0_2_p={ 32-PLAYER_HIT_X, - 6-PLAYER_HIT_Y, 42+PLAYER_HIT_X, 6+PLAYER_HIT_Y};
/* 外枠の内側(上側) */
static HIT_XY4 hit1_0_p[5]={ -28-PLAYER_HIT_X, -24-PLAYER_HIT_Y, 40+PLAYER_HIT_X, -18+PLAYER_HIT_Y,};
static HIT_XY4 hit1_0_s[5]={ -28, -24, 40, -18,};
/* 外枠の外側(上側) */
static HIT_XY4 hit1_1_p[5]={ -12-PLAYER_HIT_X, -30-PLAYER_HIT_Y, 16+PLAYER_HIT_X, -23+PLAYER_HIT_Y,};
static HIT_XY4 hit1_1_s[5]={ -12, -30, 16, -23,};
/* 外枠の内側(下側) */
static HIT_XY4 hit2_0_p[5];
static HIT_XY4 hit2_0_s[5];
/* 外枠の外側(下側) */
static HIT_XY4 hit2_1_p[5];
static HIT_XY4 hit2_1_s[5];
HIT_XY4 nohit={999,999,999,999};
HIT_XY4 hit_core_p={-5-PLAYER_HIT_X,-5-PLAYER_HIT_Y,5+PLAYER_HIT_X,5+PLAYER_HIT_Y};
HIT_XY4 hit_core_o={-5-OPTION_HIT_X,-5-OPTION_HIT_Y,5+OPTION_HIT_X,5+OPTION_HIT_Y};
HIT_XY4 hit_core_s={-5,-5,5,5};
HIT_XY4 hit_shield0_p[5];
HIT_XY4 hit_shield0_o[5];
HIT_XY4 hit_shield0_s[5]={-8,-3,8,3, -5,-3,8,3, -2,-3,8,3, 1,-3,8,3, 4,-3,8,3 };
HIT_XY4 hit_shield1_p[5];
HIT_XY4 hit_shield1_o[5];
HIT_XY4 hit_shield1_s[5]={-8,-3,8,3, -8,-3,5,3, -8,-3,2,3, -8,-3,-1,3, -8,-3,-4,3 };
static unsigned char seed=0;
/* 当たり判定の初期化 */
void InitEnemyBoss01Hit( void )
{
short i;
for(i=1;i<5;i++){
hit1_0_p[i].x1=hit1_0_p[0].x1;hit1_0_p[i].y1=hit1_0_p[0].y1-i*4;hit1_0_p[i].x2=hit1_0_p[0].x2;hit1_0_p[i].y2=hit1_0_p[0].y2-i*4;
hit1_0_s[i].x1=hit1_0_s[0].x1;hit1_0_s[i].y1=hit1_0_s[0].y1-i*4;hit1_0_s[i].x2=hit1_0_s[0].x2;hit1_0_s[i].y2=hit1_0_s[0].y2-i*4;
hit1_1_p[i].x1=hit1_1_p[0].x1;hit1_1_p[i].y1=hit1_1_p[0].y1-i*4;hit1_1_p[i].x2=hit1_1_p[0].x2;hit1_1_p[i].y2=hit1_1_p[0].y2-i*4;
hit1_1_s[i].x1=hit1_1_s[0].x1;hit1_1_s[i].y1=hit1_1_s[0].y1-i*4;hit1_1_s[i].x2=hit1_1_s[0].x2;hit1_1_s[i].y2=hit1_1_s[0].y2-i*4;
}
for(i=0;i<5;i++){
hit2_0_p[i].x1=hit1_0_p[i].x1;hit2_0_p[i].y1=(hit1_0_p[i].y2*-1);hit2_0_p[i].x2=hit1_0_p[i].x2;hit2_0_p[i].y2=(hit1_0_p[i].y1*-1);
hit2_0_s[i].x1=hit1_0_s[i].x1;hit2_0_s[i].y1=(hit1_0_s[i].y2*-1);hit2_0_s[i].x2=hit1_0_s[i].x2;hit2_0_s[i].y2=(hit1_0_s[i].y1*-1);
hit2_1_p[i].x1=hit1_1_p[i].x1;hit2_1_p[i].y1=(hit1_1_p[i].y2*-1);hit2_1_p[i].x2=hit1_1_p[i].x2;hit2_1_p[i].y2=(hit1_1_p[i].y1*-1);
hit2_1_s[i].x1=hit1_1_s[i].x1;hit2_1_s[i].y1=(hit1_1_s[i].y2*-1);hit2_1_s[i].x2=hit1_1_s[i].x2;hit2_1_s[i].y2=(hit1_1_s[i].y1*-1);
}
}
void InitEnemyCoreHit( void )
{
}
void InitEnemyShieldHit( void )
{
short i;
for(i=0;i<5;i++){
hit_shield0_p[i].x1=hit_shield0_s[i].x1-PLAYER_HIT_X;hit_shield0_p[i].x2=hit_shield0_s[i].x2+PLAYER_HIT_X;
hit_shield0_p[i].y1=hit_shield0_s[i].y1-PLAYER_HIT_Y;hit_shield0_p[i].y2=hit_shield0_s[i].y2+PLAYER_HIT_Y;
hit_shield0_o[i].x1=hit_shield0_s[i].x1-OPTION_HIT_X;hit_shield0_o[i].x2=hit_shield0_s[i].x2+OPTION_HIT_X;
hit_shield0_o[i].y1=hit_shield0_s[i].y1-OPTION_HIT_Y;hit_shield0_o[i].y2=hit_shield0_s[i].y2+OPTION_HIT_Y;
hit_shield1_p[i].x1=hit_shield1_s[i].x1-PLAYER_HIT_X;hit_shield1_p[i].x2=hit_shield1_s[i].x2+PLAYER_HIT_X;
hit_shield1_p[i].y1=hit_shield1_s[i].y1-PLAYER_HIT_Y;hit_shield1_p[i].y2=hit_shield1_s[i].y2+PLAYER_HIT_Y;
hit_shield1_o[i].x1=hit_shield1_s[i].x1-OPTION_HIT_X;hit_shield1_o[i].x2=hit_shield1_s[i].x2+OPTION_HIT_X;
hit_shield1_o[i].y1=hit_shield1_s[i].y1-OPTION_HIT_Y;hit_shield1_o[i].y2=hit_shield1_s[i].y2+OPTION_HIT_Y;
}
}
void InitEnemyBoss01(ENEMY *ene)
{
ene->vx = -1 * 65536;
ene->vy = 0;
ene->hit_p[0] = &hit0_0_p; ene->hit_p[1] = &hit0_1_p; ene->hit_p[2] = &hit0_2_p;
ene->hit_p[3] = &hit1_0_p[0]; ene->hit_p[4] = &hit1_1_p[0];
ene->hit_p[5] = &hit2_0_p[0]; ene->hit_p[6] = &hit2_1_p[0];
ene->hit_p[7] = NULL;
ene->hit_o[0] = &nohit; ene->hit_o[1] = &nohit; ene->hit_o[2] = &nohit;
ene->hit_o[3] = &nohit; ene->hit_o[4] = &nohit;
ene->hit_o[5] = &nohit; ene->hit_o[6] = &nohit;
ene->hit_o[7] = NULL;
ene->hit_s[0] = &nohit; ene->hit_s[1] = &nohit; ene->hit_s[2] = &nohit;
ene->hit_s[3] = &hit1_0_s[0]; ene->hit_s[4] = &hit1_1_s[0];
ene->hit_s[5] = &hit2_0_s[0]; ene->hit_s[6] = &hit2_1_s[0];
ene->hit_s[7] = NULL;
ene->pt = obj_boss1;
ene->info = PALET_MAIN | PRIORITY_BOSS;
ene->work = 0;
ene->no_dead = 0;
ene->func_enemy_move = MoveEnemyBoss01;
/* ene->func_enemy_tini = TiniEnemyBoss01;*/
/*
ene->parts1=MakeEnemy(ENEMY_CORE , ene->x , ene->y- 8,0, ene);ene->parts1->child=MakeEnemy(ENEMY_SHIELD , ene->parts1->x+8, ene->parts1->y,ene->parts1->arg, ene->parts1);
ene->parts2=MakeEnemy(ENEMY_CORE , ene->x+8, ene->y ,1, ene);ene->parts2->child=MakeEnemy(ENEMY_SHIELD , ene->parts2->x-8, ene->parts2->y,ene->parts2->arg, ene->parts2);
ene->parts3=MakeEnemy(ENEMY_CORE , ene->x , ene->y -8,0, ene);ene->parts3->child=MakeEnemy(ENEMY_SHIELD , ene->parts3->x+8, ene->parts3->y,ene->parts3->arg, ene->parts3);
*/
ene->parts1=MakeEnemy(ENEMY_CORE , ene->x , ene->y- 8,0, ene);ene->parts1->child=MakeEnemy(ENEMY_SHIELD , ene->parts1->x+8, ene->parts1->y,0, ene->parts1);
ene->parts2=MakeEnemy(ENEMY_CORE , ene->x+8, ene->y ,0, ene);ene->parts2->child=MakeEnemy(ENEMY_SHIELD , ene->parts2->x-8, ene->parts2->y,1, ene->parts2);
ene->parts3=MakeEnemy(ENEMY_CORE , ene->x , ene->y -8,0, ene);ene->parts3->child=MakeEnemy(ENEMY_SHIELD , ene->parts3->x+8, ene->parts3->y,0, ene->parts3);
entry_counter_stop = !0; /* エントリーカウンター停止 */
}
/* コア */
void InitEnemyCore(ENEMY *ene)
{
#if 0
typedef short (*func_enemy_move) (struct ENEMY *);
func_enemy_move FuncEnemyMove[]=
{
MoveEnemyCore1, /* 1面ボス用 */
MoveEnemyCore2, /* 2面ボス用 */
MoveEnemyCore4, /* 4面ボス用 */
};
#endif
ene->hit_p[0] = &hit_core_p;ene->hit_p[1]=NULL;
ene->hit_o[0] = &hit_core_o;ene->hit_o[1]=NULL;
ene->hit_s[0] = &hit_core_s;ene->hit_s[1]=NULL;
ene->hp = 200;
ene->pt = obj_obj;
ene->info = PALET_MAIN | PRIORITY_BOSS_PARTS;
ene->no_dead = 0;
/* ene->func_enemy_move = MoveEnemyCore;*/
/* ene->func_enemy_move = FuncEnemyMove[ene->arg](ene);*/
switch( ene->arg ){
case 0:
ene->func_enemy_move = MoveEnemyCore1;
break;
case 1:
ene->func_enemy_move = MoveEnemyCore2;
break;
case 2:
ene->func_enemy_move = MoveEnemyCore4;
break;
}
/* ene->func_enemy_tini = TiniEnemyCore;*/
}
/* 遮蔽版 */
void InitEnemyShield(ENEMY *ene)
{
HIT_XY4 *hit_p[2]={hit_shield0_p,hit_shield1_p};
HIT_XY4 *hit_o[2]={hit_shield0_o,hit_shield1_o};
HIT_XY4 *hit_s[2]={hit_shield0_s,hit_shield1_s};
short info[2]={0x0000, 0x4000};
ene->hit_p[0] = hit_p[ene->arg];ene->hit_p[1]=NULL;
ene->hit_o[0] = hit_o[ene->arg];ene->hit_p[1]=NULL;
ene->hit_s[0] = hit_s[ene->arg];ene->hit_p[1]=NULL;
ene->hp = 200;
ene->pt = obj_obj+5;
ene->info = PALET_MAIN | PRIORITY_BOSS_PARTS | info[ene->arg];
ene->work = 0;
ene->no_dead = 0;
ene->func_enemy_move = MoveEnemyShield;
/* ene->func_enemy_tini = TiniEnemyShield;*/
}
short Wait( ENEMY *ene, short time )
{
if( ene->count++ > time ){
ene->count=0;
return 1;
}
return 0;
}
static short MoveEnemyBoss01( ENEMY *ene )
{
unsigned char angle;
short anim_num;
/* 爆発 */
if( ene->dead_count ){
ene->dead_count++;
if( ene->y > 256+48+16 ){
ene->child_death=1;
if(!ene->parent){
entry_counter_stop = 0; /* エントリーカウンター停止解除 */
return (0); /* 消去 */
}else{ /* ラスボスに呼び出された場合は解除しない */
if( ene->child_kill )
return (0); /* 消去 */
}
}else{
if( !(ene->dead_count%20) ){
short exp_x,exp_y,x,y;
exp_x=rndtable[seed++]&31;seed&=255;
exp_y=rndtable[seed++]&31;seed&=255;
if( rndtable[seed++]>128 ){exp_x*=-1;exp_y*=-1;seed&=255;}
MakeEffect(EFFECT_EXPL, 0, (x=ene->x+exp_x-8), (y=ene->y+exp_y-8));
MakeEffect(EFFECT_HAHENMINI, 0, x, y);
SetSE(SE_EXPL_MBOSS); /* 爆発音 */
if( !(ene->dead_count%70) ){
MakeEffect(EFFECT_EXPLL, 0, ene->x, ene->y);
MakeEffect(EFFECT_HAHEN, 0, ene->x, ene->y);
/* MakeEffect(EFFECT_HAHENMINI, 0, ene->x, ene->y);*/
SetSE(SE_EXPL_BOSS); /* 爆発音 */
}
}
ene->y = (ene->ly += 65536/2) >> 16;
xobj_set_st(ene);
return (1);
}
}
/* 速度を足して上位ワード(固定整数部)だけ取り出す */
ene->x = (ene->lx += ene->vx) >> 16;
ene->y = (ene->ly += ene->vy) >> 16;
ene->parts1->x=((ene->parts1->lx=ene->lx+ 4*65536)>>16)-8;
ene->parts1->y=((ene->parts1->ly=ene->ly- 8*65536)>>16)-8;
ene->parts2->x=((ene->parts2->lx=ene->lx+12*65536)>>16)-8;
ene->parts2->y=((ene->parts2->ly=ene->ly )>>16)-8;
ene->parts3->x=((ene->parts3->lx=ene->lx+ 4*65536)>>16)-8;
ene->parts3->y=((ene->parts3->ly=ene->ly+ 8*65536)>>16)-8;
ene->parts1->child->x=((ene->parts1->child->lx=ene->parts1->lx-12*65536)>>16)-8; /*-8は表示位置をずらすため*/
ene->parts1->child->y=((ene->parts1->child->ly=ene->parts1->ly )>>16)-8;
ene->parts2->child->x=((ene->parts2->child->lx=ene->parts2->lx+12*65536)>>16)-8; /*-8は表示位置をずらすため*/
ene->parts2->child->y=((ene->parts2->child->ly=ene->parts2->ly )>>16)-8;
ene->parts3->child->x=((ene->parts3->child->lx=ene->parts3->lx-12*65536)>>16)-8; /*-8は表示位置をずらすため*/
ene->parts3->child->y=((ene->parts3->child->ly=ene->parts3->ly )>>16)-8;
/* printf("shi1 x=%d y=%d \n",ene->parts1->child->x,ene->parts1->child->y);
printf("shi2 x=%d y=%d \n",ene->parts2->child->x,ene->parts2->child->y);
printf("shi3 x=%d y=%d \n",ene->parts3->child->x,ene->parts3->child->y);
*/
switch (ene->work){
case 0:
if( ENE_X < 192 ){
ene->vx = 0;
ene->work++;
}
break;
case 1:
if( Wait( ene, 20 ) ){
if( ENE_Y < player[0].y ) /* プレイヤーの方に移動 */
ene->vy= 2*65536;
else
ene->vy=-2*65536;
ene->work++;
}
break;
case 2:
if( (ene->vy<0 && ENE_Y < 64 + 16) || (ene->vy>0 && ENE_Y > 192 + 16) )
ene->vy = 0;
if( Wait( ene, 40 ) ){
ene->vy=0;
ene->work++;
}
break;
case 3: /* 時間稼ぎ */
if( Wait( ene, 20 ) )ene->work++;
break;
case 4: /* 腕を広げる */
anim_num=(++ene->anim_count)/4;
ene->pt = obj_boss1+anim_num;
if( !ene->parts1->child_death )ene->parts1->pt=obj_obj+anim_num;
if( !ene->parts2->child_death )ene->parts2->pt=obj_obj+anim_num;
if( !ene->parts3->child_death )ene->parts3->pt=obj_obj+anim_num;
ene->hit_p[3] = &hit1_0_p[anim_num]; ene->hit_p[4] = &hit1_1_p[anim_num];
ene->hit_p[5] = &hit2_0_p[anim_num]; ene->hit_p[6] = &hit2_1_p[anim_num];
ene->hit_s[3] = &hit1_0_s[anim_num]; ene->hit_s[4] = &hit1_1_s[anim_num];
ene->hit_s[5] = &hit2_0_s[anim_num]; ene->hit_s[6] = &hit2_1_s[anim_num];
if( anim_num == 4){
SetSE(SE_TRANSFORM); /* ガチャン */
ene->work++;
}
break;
case 5: /* 時間稼ぎ */
if( !Wait( ene, 60 ) ){
if( ene->count==20 ){
ESHOT *eshot1,*eshot2;
/* レーザー+エネルギー弾 */
eshot1=MakeEShot(ESHOT_LASER01, ENE_X, ENE_Y, 5, 128, 4,0,ene);
eshot2=MakeEShot(ESHOT_LASER01, ENE_X, ENE_Y, 5, 128, 4,0,ene);
eshot1->box_x=-24-16;eshot1->box_y=-46-16;
eshot2->box_x=-24-16;eshot2->box_y=45-16;
MakeEShot(ESHOT_ENG03, ENE_X, ENE_Y, 5, angle=calc_direction( ENE_X, ENE_Y, P_X+CENTER_X, P_Y ), 4,0,ene);
MakeEShot(ESHOT_ENG03, ENE_X, ENE_Y, 5, (angle-12)&255, 4,0,ene);
MakeEShot(ESHOT_ENG03, ENE_X, ENE_Y, 5, (angle+12)&255, 4,0,ene);
if(level>=NOMAL){
MakeEShot(ESHOT_ENG03, ENE_X, ENE_Y, 5, (angle-24)&255, 4,0,ene);
MakeEShot(ESHOT_ENG03, ENE_X, ENE_Y, 5, (angle+24)&255, 4,0,ene);
}
SetSE(SE_LASER01); /* 敵ショット音 */
}
}else{
ene->work++;
SetSE(SE_ESHOT_SYURIKEN); /* 次のショット音 */
}
break;
case 6:
/* 手裏剣 */
MakeEShot(ESHOT_SYURIKEN, ENE_X, ENE_Y, 5, ene->angle, 4,0,ene);
if(level>=HARD)
MakeEShot(ESHOT_RING01, ENE_X, ENE_Y, 8, (ene->angle+8)&255, 4,0,ene);
if( (ene->angle+=16)>255 ){
ene->angle=0;
ene->work++;
}
break;
case 7: /* 時間稼ぎ */
if( Wait( ene, 20 ) )ene->work++;
break;
case 8: /* 腕を閉じる */
anim_num=(--ene->anim_count)/4;
ene->pt = obj_boss1+anim_num;
if( !ene->parts1->child_death )ene->parts1->pt=obj_obj+anim_num;
if( !ene->parts2->child_death )ene->parts2->pt=obj_obj+anim_num;
if( !ene->parts3->child_death )ene->parts3->pt=obj_obj+anim_num;
ene->hit_p[3] = &hit1_0_p[anim_num]; ene->hit_p[4] = &hit1_1_p[anim_num];
ene->hit_p[5] = &hit2_0_p[anim_num]; ene->hit_p[6] = &hit2_1_p[anim_num];
ene->hit_s[3] = &hit1_0_s[anim_num]; ene->hit_s[4] = &hit1_1_s[anim_num];
ene->hit_s[5] = &hit2_0_s[anim_num]; ene->hit_s[6] = &hit2_1_s[anim_num];
if( anim_num == 0 ){
SetSE(SE_TRANSFORM); /* ガチャン */
ene->anim_count=0;
ene->work=1;
}
break;
}
#if 0
ene->lx = 192*65536;
ene->ly = 192*65536;
ene->vx = 0;
ene->vy = 0;
if( BITSNS(0x04) & BIT(1) ){
while( BITSNS(0x04) & BIT(1) );
entry_counter_stop = 0;
return (0);
}
#endif
/* コアが全部破壊された時の処理 */
if( ene->parts1->child_death && ene->parts2->child_death && ene->parts3->child_death ){
MakeEffect(EFFECT_EXPLL, 0, ene->x, ene->y);
SetSE(SE_EXPL_BOSS); /* 爆発音 */
MakeEffect (EFFECT_HAHEN, 0, ene->x, ene->y);
if(!eshot_erase)
eshot_erase = ESHOT_ERASE; /* 弾消し */
ene->player->score += 10;
ene->parts1->child_kill=1;
ene->parts2->child_kill=1;
ene->parts3->child_kill=1;
ene->hit_p[0]=NULL;
ene->dead_count=1;
}
xobj_set_st(ene);
xsp_set_st(ene->parts1);xsp_set_st(ene->parts1->child);
xsp_set_st(ene->parts2);xsp_set_st(ene->parts2->child);
xsp_set_st(ene->parts3);xsp_set_st(ene->parts3->child);
return(1);
}
static short MoveEnemyCore1( ENEMY *ene )
{
if( ene->child_death ){
if( ene->child_kill ){
ene->child->child_kill=1;
return (0); /* 消去 */
}else
return(1);
}
/* ダメージを受けた時の処理 */
if( ene->damage && ene->pt == obj_obj+4 && ene->child->child_death ){
SetSE(SE_CORE_DAMAGE); /* 効果音 */
ene->info = PALET_DAMAGE | PRIORITY_BOSS_PARTS;
if((ene->hp -= ene->damage) <= 0) {
MakeEffect(EFFECT_EXPLMINI, 0, ene->x, ene->y);
SetSE(SE_EXPL_MBOSS); /* 爆発音 */
if(!eshot_erase)
eshot_erase = ESHOT_ERASE; /* 弾消し */
ene->player->score += 5;
ene->child_death = 1;
ene->pt=obj_moji; /* 見えなくする */
ene->hit_p[0]=NULL;
}
}else
ene->info = PALET_MAIN | PRIORITY_BOSS_PARTS;
ene->damage = 0;
return(1);
}
static short MoveEnemyCore2( ENEMY *ene )
{
if( ene->child_death ){
if( ene->child_kill )
return (0); /* 消去 */
return(1);
}
/* ダメージを受けた時の処理 */
if( ene->damage && ene->pt == obj_obj+4 ){
SetSE(SE_CORE_DAMAGE); /* 効果音 */
ene->info &= 0xFF;
ene->info |= PALET_DAMAGE;
if((ene->hp -= ene->damage) <= 0) {
MakeEffect(EFFECT_EXPLMINI, 0, ene->x, ene->y);
SetSE(SE_EXPL_MBOSS); /* 爆発音 */
if(!eshot_erase)
eshot_erase = ESHOT_ERASE; /* 弾消し */
ene->player->score += 5;
ene->child_death = 1;
ene->pt = obj_obj+0xA; /* 見えなくする */
ene->info = PALET_MAIN | PRIORITY_BOSS_PARTS;
ene->hit_p[0]=NULL;
}
}else{
ene->info &= 0xFF;
ene->info |= PALET_MAIN;
}
ene->damage = 0;
return(1);
}
static short MoveEnemyCore4( ENEMY *ene )
{
if( ene->child_death ){
if( ene->child_kill ){
ene->parts1->child_kill=1;
ene->parts2->child_kill=1;
return (0); /* 消去 */
}else
return(1);
}
/* ダメージを受けた時の処理 */
/* 両側のシールドが壊されて、コアが開いているとき */
if( ene->damage && ene->pt == obj_obj+4 && ene->parts1->child_death && ene->parts2->child_death ){
SetSE(SE_CORE_DAMAGE); /* 効果音 */
ene->info = PALET_DAMAGE | PRIORITY_BOSS_PARTS;
if((ene->hp -= ene->damage) <= 0) {
MakeEffect(EFFECT_EXPLMINI, 0, ene->x, ene->y);
SetSE(SE_EXPL_MBOSS); /* 爆発音 */
if(!eshot_erase)
eshot_erase = ESHOT_ERASE; /* 弾消し */
ene->player->score += 5;
ene->child_death = 1;
ene->pt=obj_moji; /* 見えなくする */
ene->hit_p[0]=NULL;
}
}else
ene->info = PALET_MAIN | PRIORITY_BOSS_PARTS;
ene->damage = 0;
return(1);
}
static short MoveEnemyShield( ENEMY *ene )
{
HIT_XY4 *hit_p[2][5]={
&hit_shield0_p[0],&hit_shield0_p[1],&hit_shield0_p[2],&hit_shield0_p[3],&hit_shield0_p[4],
&hit_shield1_p[0],&hit_shield1_p[1],&hit_shield1_p[2],&hit_shield1_p[3],&hit_shield1_p[4],
};
HIT_XY4 *hit_o[2][5]={
&hit_shield0_o[0],&hit_shield0_o[1],&hit_shield0_o[2],&hit_shield0_o[3],&hit_shield0_o[4],
&hit_shield1_o[0],&hit_shield1_o[1],&hit_shield1_o[2],&hit_shield1_o[3],&hit_shield1_o[4],
};
HIT_XY4 *hit_s[2][5]={
&hit_shield0_s[0],&hit_shield0_s[1],&hit_shield0_s[2],&hit_shield0_s[3],&hit_shield0_s[4],
&hit_shield1_s[0],&hit_shield1_s[1],&hit_shield1_s[2],&hit_shield1_s[3],&hit_shield1_s[4],
};
short info[2]={0x0000, 0x4000};
if( ene->child_kill )
return (0); /* 消去 */
/* ダメージを受けた時の処理 */
if(ene->damage){
SetSE(SE_SHIELD_DAMAGE); /* 効果音 */
ene->info = PALET_DAMAGE | PRIORITY_BOSS_PARTS | info[ene->arg];
if( (ene->hp -= ene->damage) <= 0 ){
MakeEffect(EFFECT_EXPLMINI, 0, ene->x, ene->y);
SetSE(SE_EXPL_MBOSS); /* 爆発音 */
ene->player->score += 2;
ene->child_death = 1;
ene->hit_p[0]=NULL;
}
ene->damage = 0;
}else
ene->info = PALET_MAIN | PRIORITY_BOSS_PARTS | info[ene->arg];
if(ene->hp <= 0){
ene->pt = obj_moji; /* 見えなくする */
}else if(ene->hp <= 40){
ene->pt = obj_obj+9;
ene->hit_p[0] = hit_p[ene->arg][4];
ene->hit_o[0] = hit_o[ene->arg][4];
ene->hit_s[0] = hit_s[ene->arg][4];
}else if(ene->hp <= 80){
ene->pt = obj_obj+8;
ene->hit_p[0] = hit_p[ene->arg][3];
ene->hit_o[0] = hit_o[ene->arg][3];
ene->hit_s[0] = hit_s[ene->arg][3];
}else if(ene->hp <=120){
ene->pt = obj_obj+7;
ene->hit_p[0] = hit_p[ene->arg][2];
ene->hit_o[0] = hit_o[ene->arg][2];
ene->hit_s[0] = hit_s[ene->arg][2];
}else if(ene->hp <=160){
ene->pt = obj_obj+6;
ene->hit_p[0] = hit_p[ene->arg][1];
ene->hit_o[0] = hit_o[ene->arg][1];
ene->hit_s[0] = hit_s[ene->arg][1];
}
/* xsp_set_st(ene);*/
return(1);
}
/*
static void TiniEnemyBoss01(ENEMY * p)
{
}
*/